<?php if(!defined('APP_PATH')||!defined('DOYO_PATH')||empty($_SESSION['member'])){exit('Access Denied');}?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
body {
	background-color: #FFF; margin:0; font-size:12px; color: #666;
}
</style>
<script src="{$GLOBALS['WWW']}include/js/jquery.js" type="text/javascript"></script>
<script src="{$GLOBALS['WWW']}include/js/uploadify/swfobject.js" type="text/javascript"></script>
<script src="{$GLOBALS['WWW']}include/js/uploadify/uploadify.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	$("#files").uploadify({
		'script'         : 'index.php',
		'scriptData'	 : {'c':'member','a':'m_upload','isfiles':'Filedata','inputid':'<?php echo $inputid;?>','hand':'<?php echo $hand;?>','session_id':'<?php echo session_id();?>'},
		'queueID'        : 'fileQueue',
		'auto'           : true,	//自动上传
		'multi'          : false,	//是否可以传多个文件
		'removeCompleted': true,	//完成移除进度条
		'fileDesc' 		 : '选择文件',
		'fileExt'		 : '<?php echo $fileExt ?>',		//格式限制
		'sizeLimit'		 : <?php echo $sizeLimit ?>,	//大小限制
		"onError": function (event,queueId,fileObj,errorObj){
				$("#err").empty();$("#fileQueue").empty();
				if(errorObj.type=="File Size"){
					var fSizes = errorObj.info/1024;
					$("#err").append("文件大小不能超过"+fSizes+"K");
				}else{
					$("#err").append("上传出错，请重新操作");
				}
		},
		'onOpen': function (){
				$("#err").empty();
				$("#err").append("<img src='include/js/uploadify/loading.gif' />");
		},
		'onComplete': function (event, queueID, fileObj, response, data){				
				var strs=response.split(",");
				var tt=response.substring(0,3);
				$("#err").empty();
				if(tt.indexOf('0,')==-1){
					$("#fileQueue").empty();
					$("#err").append(strs[0]);
				}else{
					$(window.parent.document).find("#<?php echo $inputid ?>").attr("value",strs[1]);
				}
		}
	});
});
</script>
</head>
<body>

<style type="text/css">
.uploadifyQueueItem {width: 150px; font-size:10px; font-family:Verdana, Geneva, sans-serif; line-height:13px;}
.uploadifyError {background-color: #FDE5DD !important;}
.uploadifyQueueItem .cancel {float: right; padding-top:6px;}
.uploadifyQueue .completed {}
.uploadifyProgress {margin-top: 10px;width: 100%;}
.uploadifyProgressBar {background-color: #0099FF;height: 3px;width: 1px;}
</style>
<div style="float:left; height:26px; width:90px; "><input name="files" id="files" type="file" /></div><div id="err" style="float:left; line-height:26px; margin-right:3px;"></div><div id="fileQueue" style="float:left;"></div>
</body>
</html>
